<?php
/**
 * Created by PhpStorm.
 * User: keyth
 * Date: 18-4-8
 * Time: 下午7:09
 */
namespace app\model;
use think\Model;

class Tea_lab extends Model
{
    static public function getTea($id){
        if(!empty($id)){
            $tea=Teacher::get($id);
        }else{
            $tea=new Teacher();
            $tea->username='';
        }
        return $tea;

    }
    static public function getLab($id){
        if(!empty($id)){
            $lab=Lab::get($id);
        }else{
            $lab=new Lab();
            $lab->week=1;
            $lab->node=1;
            $lab->address='无';

        }
        return $lab;
    }
    static public function is_Stu_select($uid,$tl_id){
        $Stu_tea_lab=NEW Stu_tea_lab();
        if($Stu_tea_lab->where('stu_id',$uid)->where('tea_lab_id',$tl_id)->select()){
            return 1;
        }
        return 0;


    }


}